<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button {
            float: left;
            margin-left: 100px;
        }
    </style>
</head>

<body>
    <div id="app">
        <img v-show="ann" src="./img/45.png" alt="">
        <button @click='btnn'>{{btn}}</button>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                btn: '关闭',
                ann: true
            },
            methods: {
                btnn: function() {
                    if (this.ann == true) {
                        this.btn = '开启'
                        this.ann = false;
                        console.log(this.ann);
                    } else if (this.ann == false) {
                        this.btn = '关闭'
                        this.ann = true
                        console.log(this.ann);
                    }
                }
            }
        })
    </script>
</body>

</html>